﻿using System;
using System.Text.RegularExpressions;

namespace RegularExpresions
{
    class RegularExpresionsTest
    {
        static void Main(string[] args)
        {
            string pattern = @"test[\w]*";
            string text = "Testing is important. We need to test everything.";
            Match match = Regex.Match(text, pattern, RegexOptions.IgnoreCase);
            while (match.Success)
            {
                Console.WriteLine(
                    "String: \"{0}\" - start {1}, end {2}",
                    match, match.Index, match.Length);
                match = match.NextMatch();
            }
        }
    }
}